Description

This RMD will look in some detail at the items that have had unusually high price changes in the pandemic.

Data

The following code (not shown in markdown) will import and format the BEA data from csv tables. All of this is duplicated from Wavelet Analysis of Variance v2.

Query the Data

The following function (not shown in markdown) allows querying the main tables (exp, qua, and pri) based on item levels, where goods and services are level 1; durable goods, nondurable goods, and HH cons exp on services are level 2; and so on. Often, we’ll want the lowest (i.e. most granular level), which can be retrieved with the lowestLevel = T parameter. This is the same as in Process PCE Data.Rmd

Build Data

This will build the itemClass table that’s the same in Wavelet Analysis of Variance v2.RMD.

##                                                     Item Pan.Price.Pct.Chg
## 97    Less: Personal remittances in kind to nonresidents          13.99532
## 51                                      Fish and seafood          14.47634
## 154                                        Pension funds          14.47958
## 191                                    Domestic services          15.03469
## 9                                                  Tires          15.27404
## 50                                               Poultry          15.92873
## 11                                             Furniture          17.67825
## 48                                                  Pork          19.37330
## 54                                                  Eggs          20.21869
## 47                                         Beef and veal          23.39831
## 15                            Major household appliances          24.32774
## 66               Food produced and consumed on farms (6)          24.98299
## 73                         Gasoline and other motor fuel          30.06328
## 107                                     Natural gas (28)          30.07890
## 76                                           Other fuels          30.58331
## 75                                              Fuel oil          32.74359
## 6                                 Employee reimbursement          33.14583
## 118                                 Motor vehicle rental          33.14643
## 4                         Net transactions in used autos          54.63929
## 7                        Net transactions in used trucks          54.63959
## 8                                      Used truck margin          85.93548
## 5                                       Used auto margin          85.93752
## NA                                                  <NA>                NA
## NA.1                                                <NA>                NA
## NA.2                                                <NA>                NA
## NA.3                                                <NA>                NA
## NA.4                                                <NA>                NA
## NA.5                                                <NA>                NA
## NA.6                                                <NA>                NA
## NA.7                                                <NA>                NA
## NA.8                                                <NA>                NA
## NA.9                                                <NA>                NA
## NA.10                                               <NA>                NA
## NA.11                                               <NA>                NA
## NA.12                                               <NA>                NA
## NA.13                                               <NA>                NA
## NA.14                                               <NA>                NA
## NA.15                                               <NA>                NA

As a first pass, I want to grab only those items whose pandemic average monthly percentage price change was 0.5 above the average in the decade prior to the pandemic. Here they are, including the wavelet correlation (P & Q) for the first detail (2-4 months).

  Item Pan.Avg.Chg Pre.Pan.Avg.Chg d1Cor
179 Televisions 0.04487 -1.507 -0.3643
138 Personal computers/tablets and peripheral equipment 0.2197 -0.6021 -0.4598
142 Photographic equipment 0.3856 -0.3316 -0.2799
172 Sporting equipment, supplies, guns, and ammunition (part of 80) 0.4298 -0.2012 -0.3276
18 Clocks, lamps, lighting fixtures, and other household decorative items 0.4051 -0.4838 -0.4975
129 Outdoor equipment and supplies 0.5225 -0.02897 -0.3085
109 New domestic autos 0.5536 0.02167 -0.1925
110 New foreign autos 0.5536 0.02167 -0.1353
183 Tires 0.6081 0.02536 -0.2418
147 Poultry 0.6443 0.1174 -0.5309
56 Furniture 0.7242 -0.0658 -0.1541
146 Pork 0.7978 0.1631 -0.487
32 Eggs 0.7775 0.1276 -0.9262
8 Beef and veal 0.9378 0.3452 -0.4467
89 Major household appliances 1.082 -0.1734 -0.2658
46 Food produced and consumed on farms (6) 0.7018 0.184 -0.9843
59 Gasoline and other motor fuel 1.111 0.08246 0
105 Natural gas (28) 1.081 -0.09427 -0.2258
120 Other fuels 1.156 0.02632 -0.271
54 Fuel oil 1.092 0.08646 -0.4041
37 Employee reimbursement 1.462 0.07295 -0.7016
100 Motor vehicle rental 1.462 0.07295 -0.1651
107 Net transactions in used autos 1.878 -0.0265 0
108 Net transactions in used trucks 1.878 -0.0265 0
190 Used truck margin 2.933 -0.1866 0
189 Used auto margin 2.933 -0.1866 0

Analysis Using Continuous Wavelet Transforms

Whether using discrete or continuous wavelet transforms, wavelet analysis is, in essence, a way to characterize the “spectral characteristics of a time-series as a function of time, revealing how the different periodic components of a particular time-series evolve over time,” (Aguiar-Conraria and Soares 2011, 478). Whereas Fourier transforms show the frequency distribution of a whole series, wavelets can locate power at various frequencies for particular times in the series. This is done by projecting a wavelet at different scales, s, (widths) and translations, \(\tau\) (time locations) onto the series, \(x_t\). Hence, the continuous wavelet transform with respect to a chosen wavelet function \(\psi\) can be expressed as:

\[W_x(\tau, s) = \int x_t \left[\frac{1}{\sqrt{|s|}}\bar\psi \left(\frac{t-\tau}{s} \right) \right]\]

with the bar denoting complex conjugation (Auigar-Conraria and Soares 2011, 479). As we will ultimately be looking at synchronism between price and quantity for our Personal Consumption Expenditure items, an analytic wavelet is appropriate. As Aquiar-Conraria and Soares (2011, 479) note, “Analytic wavelets are ideal for the analysis of oscillatory signals, since the continuous analytic wavelet transform provides an estimate of the instantaneous amplitude and instantaneous phase of the signal in the vicinity of each time/scale location (\(\tau\), s).” Following those same authors, we utilize the Morlet wavelet, given by

\[\psi_{\omega_0}(t) = \pi^{-1/4}e^{i\omega_0t}e^{-\frac{t^2}{2}}\]

See Aquiar-Conraria and Soares (2011, 479) for the advantages of using this wavelet.

Once the wavelet is chosen, it is possible to calculate wavelet power spectra showing the distribution of variance in terms of both scale (frequency) and time. Furthermore, wavelet coherency between two time-series can be calculated (see Aguiar-Conraria and Soares 2011, 49-80 for more information).

(Note: the authors develop a system for comparing ‘distance’ between two wavelet spectra which they’ll use for cluster analysis. We might want to try this at some point, though it would be essentially similar, I think, to the DWT stuff we did. A good check at the least, but possibly just a superior approach.)

[Wavecomp looks like a significant extension of the Aguiar… stuff. Lots of good examples in its documentation]

Here are the Continuous Wavelet Transform plots for those items.